package com.infonova.product.jtf.blame.dto;

import java.util.ArrayList;
import java.util.List;


public class CallGraph {

    private List<Call> calls = new ArrayList<Call>();
    private TestedMethod method;

    public CallGraph(TestedMethod method) {
        this.method = method;
    }

    
    public TestedMethod getMethod() {
        return method;
    }

    
    public void setMethod(TestedMethod method) {
        this.method = method;
    }

    public void add(int level, String clazzName, String methodName, String... parameterTypes) {
        calls.add(new Call(level, clazzName, methodName, parameterTypes));
    }


    public List<Call> getCalls() {
        return calls;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(method.toString());
        for (Call call : getCalls()) {
            sb.append(call.toString()).append("\n");
        }
        return sb.toString();
    }

}
